-- GENERATED SPELL FOR [Twilight Cryomancer] --


function spell0_26222(pUnit, Event) --@Frost Armor,Self--
pUnit:FullCastSpellOnTarget(12544,pUnit)
pUnit:RegisterEvent('Sorts_26222', 0, 1)
end

function spell1_26222(pUnit, Event) --@Frost Nova,Self--
pUnit:FullCastSpellOnTarget(11831,pUnit)
pUnit:RegisterEvent('Sorts_26222', 8325, 1)
end

function spell2_26222(pUnit, Event) --@Frostbolt,n/a--
pUnit:FullCastSpellOnTarget(9672,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_26222', 7000, 1)
end

function Sorts_26222(pUnit, Event)
local choix_sorts_26222 = math.random(0, 2)
if choix_sorts_26222 == 0 then
pUnit:RegisterEvent('spell0_26222', 1, 1)
end
if choix_sorts_26222 == 1 then
pUnit:RegisterEvent('spell1_26222', 1, 1)
end
if choix_sorts_26222 == 2 then
pUnit:RegisterEvent('spell2_26222', 1, 1)
end
end

function mob26222_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_26222', math.random(1500, 3000), 1)
end

function mob26222_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob26222_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob26222_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(26222, 1, 'mob26222_Action')
RegisterUnitEvent(26222, 2, 'mob26222_Leave')
RegisterUnitEvent(26222, 3, 'mob26222_Kill')
RegisterUnitEvent(26222, 4, 'mob26222_Die')
